<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
<%@ include file="/WEB-INF/pages/common/jquery2.1.4.jsp"%>
<%@ include file="/WEB-INF/pages/common/back-dialog.jsp"%>
<script src="${contextPath}/resources/common/js/echarts.min.js" type="text/javascript"></script>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<script src="<ls:templateResource item='/resources/plugins/My97DatePicker/WdatePicker.js'/>" type="text/javascript"></script>
	<table class="${tableclass}" style="width: 100%">
	   <tr><th><strong class="am-text-primary am-text-lg">项目管理</strong> /  项目报表 - ${userRealName}
	    	</th></tr>
	</table>    
    <form action="<ls:url address='/admin/myteam/userReport/${user.name}'/>" id="form1" method="post">
        <table class="${tableclass}" style="width: 100%">
		    <tbody><tr><td>
		    	    <div align="left" style="padding: 3px">
				     从: 
					<input readonly="readonly"  name="startDate" id="startDate" class="Wdate" type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:function(){endDate.focus();},maxDate:'#F{$dp.$D(\'endDate\')}'})" value='<fmt:formatDate value="${startDate}" pattern="yyyy-MM-dd"/>' />
					
					到: 
					<input readonly="readonly" name="endDate" id="endDate" class="Wdate" type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'startDate\')}'})" value='<fmt:formatDate value="${endDate}" pattern="yyyy-MM-dd"/>' />
				    
				            <input type="submit" value="搜索"/>
				      </div>
		     </td></tr></tbody>
	    </table>
    </form>
    <div align="center">
		<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
		<div id="main" style="width: 100%;height:400px;"></div>
          <%@ include file="/WEB-INF/pages/common/messages.jsp"%>
		<display:table name="list" requestURI="/admin/myteam/userReport/${item.name}" id="item" export="false" sort="external" class="${tableclass}" style="width:100%">
			<display:column title="项目Id" property="projectId"></display:column>
			<display:column title="项目名称" property="projectName"></display:column>
     		<display:column title="总耗时"><fmt:formatNumber pattern="#.##" value="${item.consumed}" /></display:column>
     		<display:column title="总人天/8" ><fmt:formatNumber pattern="#.##" value="${item.consumed / 8}" /></display:column>
     		<display:column title="总人月/8/23" ><fmt:formatNumber pattern="#.##" value="${item.consumed / 8 / 23}"></fmt:formatNumber> </display:column>
     		<display:footer>
     			<tr style="font-weight: bold;">
     				<td colspan="2">Total</td>
     				<td><fmt:formatNumber pattern="#.##" value="${totalConsumedHours}" /></td>
     				<td><fmt:formatNumber pattern="#.##" value="${totalConsumedHours / 8 }"></fmt:formatNumber></td>
     				<td><fmt:formatNumber pattern="#.##" value="${totalConsumedHours / 8 / 23}"></fmt:formatNumber></td>
     			</tr>
     		</display:footer>
	    </display:table>
    </div>


<script type="text/javascript">
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById('main'));

	// 指定图表的配置项和数据
	var option = {
		title: {
			text: '工时统计'
		},
		tooltip: {},
		legend: {
			data:['工时统计']
		},
		xAxis: {
			name: '项目',
			data: ${names},
			axisLabel: {
				interval: 0
			}
		},
		yAxis: {},
		series: [{
			name: '工时',
			type: 'bar',
			data: ${consumed}
		}]
	};

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(option);
</script>